package br.eti.robsonfranca.clf4j.impl;

import br.eti.robsonfranca.clf4j.enums.ColorCode;

public class Color {
	private final ColorCode code;
	private final boolean bright;
		
	/**
	 * @return the code
	 */
	public ColorCode getCode() {
		return code;
	}
	/**
	 * @return the bright
	 */
	public boolean isBright() {
		return bright;
	}

	public Color(ColorCode code, boolean bright) {
		this.code = code;
		this.bright = bright;
	}
	
	public String ansiCode(boolean foreground) {
		return String.format("%d%s", code.value(foreground), bright ? ";1" : "");
	}
}
